package com.hw.utils;

import java.text.SimpleDateFormat;

public class StringUtils extends org.apache.commons.lang.StringUtils {
	
	
	public static String substringBetween2(String str, String tag1, String tag2) {
		return tag1+substringBetween(str, tag1, tag2)+tag2;
	}
	/**
     * 将对象转换了字符型
     *
     * @param s
     */
    public static String null2String(Object s) {
        return s == null || s.equals("null") || s.equals("NULL") ? "" : s.toString();
    }
    
    public static boolean isValidDate(String datestr){
    	 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    	boolean flag =true;
    		try {
    			format.setLenient(false);
				format.parse(datestr);
			} catch (java.text.ParseException e) {			
				flag=false;
			}
		return flag;
    	
    }
}
